﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class CheckTouch : MonoBehaviour
{

    public Slider slider;
    public Action action;
    bool isGet = false;
    int touchID = -1;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        slider.value -= 0.005f;
    }

    public void TouchCheck()
    {
        slider.value += 0.1f;
    }

    public void CheckValue()
    {
        if(slider.value >= 0.6f && !isGet)
        {
            isGet = true;
            gameObject.SetActive(false);
            //黑包视频
            if (!AdManager1.instance.ShieldAddress) AdManager.ShowVideo(null);
            action?.Invoke();
        }
    }
}
